package hui.zhang.web.action.transit;

import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Namespace;
import org.apache.struts2.convention.annotation.ParentPackage;
import org.apache.struts2.convention.annotation.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import hui.zhang.domain.transit.DeliveryInfo;
import hui.zhang.service.transit.DeliveryInfoService;
import hui.zhang.utils.BaseAction;

/**
 * @author hui.zhang
 * @date 2018年1月4日 下午2:03:02
 */
@ParentPackage("struts-default")
@Namespace("/")
@Controller
@Scope("prototype")
@SuppressWarnings("all")
public class DeliveryInfoAction extends BaseAction<DeliveryInfo> {

	@Autowired
	private DeliveryInfoService deliveryInfoService;
	
	private String transitInfoId;
	public void setTransitInfoId(String transitInfoId) {
		this.transitInfoId = transitInfoId;
	}

	@Action(value = "delivery_save", results = {
			@Result(name = "success", location = "/pages/transit/transitinfo.html", type = "redirect") })
	public String save() {
		deliveryInfoService.save(model, transitInfoId);
		return SUCCESS;
	}

}
